package AIbyDavid;

import java.util.ArrayList;

public class Main {
	public static void main(String args[]) {
//		if(args[0]!=null){
//			System.out.println(args[0]);
//			System.out.println(args[1]);
//		}
		final boolean task1 = false;
		if (task1) {
			Population p = new Population();
			int i = 0;
			long before = System.currentTimeMillis();
			while (!p.nextIteration()) {
				i++;
//				System.out.println(p);
//				System.out.println("->Staring Iteration " + i);
			}
			long time = System.currentTimeMillis() - before;
			System.out.println("Solution obtained in " + time + "ms("+i+" generations)");
			System.out.println();
		} else
		// ---------------------------------------------------------------------
		// Task2
		{
			boolean useElitsim=false;
			boolean useTruncation=false;
			int pop=Integer.parseInt(args[0]);
			int popinc=Integer.parseInt(args[1])-5;
			int gen=Integer.parseInt(args[2]);
			int trunc=Integer.parseInt(args[3]);
			int eli=Integer.parseInt(args[4]);
			int rep=Integer.parseInt(args[5]);
			
			if(trunc==1){
				useTruncation=true;
			}
			if(eli==1){
				useElitsim=true;
			}
			
			
			new Experiment(pop, popinc, gen, useTruncation,useElitsim, rep);
		}

	}
}
